DataSource for Entity Framework in WPF
C1.LiveLinq.AdoNet Namespace / AdoNetExtensions Class / AsIndexed Method / AsIndexed<TRow>(DataTable) Method
The type of the rows in the table.
A System.Data.DataTable to represent as an IndexedDataTable<TRow>.

In This Topic
    AsIndexed<TRow>(DataTable) Method
    In This Topic
    Wraps a System.Data.DataTable in an IndexedDataTable<TRow> so it can be indexed and queried using the optimized query operators from C1.LiveLinq.IndexedQueryExtensions.
    Syntax
    'Declaration
     
    Public Overloads Shared Function AsIndexed(Of TRow As DataRow)( _
       ByVal table As DataTable _
    ) As IndexedDataTable(Of TRow)
    public static IndexedDataTable<TRow> AsIndexed<TRow>( 
       DataTable table
    )
    where TRow: DataRow

    Parameters

    table
    A System.Data.DataTable to represent as an IndexedDataTable<TRow>.

    Type Parameters

    TRow
    The type of the rows in the table.

    Return Value

    An IndexedDataTable<TRow> that contains the same rows as table and enables indexing of its rows.
    Remarks

    Use this method to index ADO.NET data tables and query them using the query operators optimized with indexing.

    Elements of the source data table aren't duplicated or copied to a new collection. This method just wraps the original data table in an IndexedDataTable<TRow>.

    Note: The IndexedDataTable<TRow> wrapper is owned by the original System.Data.DataTable object (in fact, it is stored in its ExtendedProperties). So, if you create a wrapper for the same data table several times, it will be the same object.
    See Also